{{define "PrintExtra"}}
	{{if .PercentChange}}
		{{$numVal := (dereference .PercentChange)}}
		{{if ge $numVal 0.0}}
			<span class="positive-delta">
		{{else}}
			<span class="negative-delta">
		{{end}}
		{{printf "%+.1f" $numVal}}%
		</span>
	{{end}}
	{{if .PValue}}
		p={{printf "%.2f" (dereference .PValue)}}
	{{end}}
{{end}}

{{$uiTable := .}}
{{if .Table}}
{{if $uiTable.AlignedBy}}
	The data are aligned by {{$uiTable.AlignedBy}} <br />
{{end}}
<table class="list_table">
	<thead><tr>
	<th>{{.Table.TopLeftHeader}}</th>
	{{range $c := .Table.ColumnHeaders}}
		<th>
		{{$url := ""}}
		{{if $uiTable.ColumnURL}}{{$url = (call $uiTable.ColumnURL $c)}}{{end}}
			{{if $url}}<a href="{{$url}}">{{$c}}</a>
			{{else}}
			{{$c}}
			{{end}}
		</th>
		{{if $uiTable.Extra}}
		<th>Δ</th>
		{{end}}
	{{end}}
	</tr></thead>
	<tbody>
	{{range $r := .Table.SortedRows}}
	<tr>
		<td>
		{{$url := ""}}
		{{if $uiTable.RowURL}}{{$url = (call $uiTable.RowURL $r)}}{{end}}
			{{if $url}}<a href="{{$url}}">{{$r}}</a>
			{{else}}
			{{$r}}
			{{end}}
		</td>
		{{range $c := $uiTable.Table.ColumnHeaders}}
			{{$cell := ($uiTable.Table.Get $r $c)}}
			<td>{{if $cell}}{{$cell}}{{end}}</td>
			{{if $uiTable.Extra}}
			<td>{{if $cell}}{{template "PrintExtra" $cell}}{{end}}</td>
			{{end}}
		{{end}}
	</tr>
	{{end}}
	{{if $uiTable.HasFooter}}
		<tr>
			<td>-</td>
			{{range $c := $uiTable.Table.ColumnHeaders}}
				<td>{{$uiTable.Table.GetFooterValue $c}}</td>
			{{end}}
		</tr>
	{{end}}
	</tbody>
</table>
{{end}}
